/**
 */
package oo2rdb.impl;

import oo.OoPackage;

import oo.impl.OoPackageImpl;

import oo2rdb.At2C;
import oo2rdb.At2F;
import oo2rdb.Attr;
import oo2rdb.Inh;
import oo2rdb.Oo2rdbFactory;
import oo2rdb.Oo2rdbPackage;

import org.eclipse.emf.ecore.EClass;
import org.eclipse.emf.ecore.EPackage;
import org.eclipse.emf.ecore.EReference;

import org.eclipse.emf.ecore.impl.EPackageImpl;

import rdb.RdbPackage;

import rdb.impl.RdbPackageImpl;

/**
 * <!-- begin-user-doc -->
 * An implementation of the model <b>Package</b>.
 * <!-- end-user-doc -->
 * @generated
 */
public class Oo2rdbPackageImpl extends EPackageImpl implements Oo2rdbPackage {
	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	private EClass c2TEClass = null;

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	private EClass at2CEClass = null;

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	private EClass a2FEClass = null;

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	private EClass at2FEClass = null;

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	private EClass inhEClass = null;

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	private EClass attrEClass = null;

	/**
	 * Creates an instance of the model <b>Package</b>, registered with
	 * {@link org.eclipse.emf.ecore.EPackage.Registry EPackage.Registry} by the package
	 * package URI value.
	 * <p>Note: the correct way to create the package is via the static
	 * factory method {@link #init init()}, which also performs
	 * initialization of the package, or returns the registered package,
	 * if one already exists.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see org.eclipse.emf.ecore.EPackage.Registry
	 * @see oo2rdb.Oo2rdbPackage#eNS_URI
	 * @see #init()
	 * @generated
	 */
	private Oo2rdbPackageImpl() {
		super(eNS_URI, Oo2rdbFactory.eINSTANCE);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	private static boolean isInited = false;

	/**
	 * Creates, registers, and initializes the <b>Package</b> for this model, and for any others upon which it depends.
	 * 
	 * <p>This method is used to initialize {@link Oo2rdbPackage#eINSTANCE} when that field is accessed.
	 * Clients should not invoke it directly. Instead, they should simply access that field to obtain the package.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #eNS_URI
	 * @see #createPackageContents()
	 * @see #initializePackageContents()
	 * @generated
	 */
	public static Oo2rdbPackage init() {
		if (isInited) return (Oo2rdbPackage)EPackage.Registry.INSTANCE.getEPackage(Oo2rdbPackage.eNS_URI);

		// Obtain or create and register package
		Oo2rdbPackageImpl theOo2rdbPackage = (Oo2rdbPackageImpl)(EPackage.Registry.INSTANCE.get(eNS_URI) instanceof Oo2rdbPackageImpl ? EPackage.Registry.INSTANCE.get(eNS_URI) : new Oo2rdbPackageImpl());

		isInited = true;

		// Obtain or create and register interdependencies
		OoPackageImpl theOoPackage = (OoPackageImpl)(EPackage.Registry.INSTANCE.getEPackage(OoPackage.eNS_URI) instanceof OoPackageImpl ? EPackage.Registry.INSTANCE.getEPackage(OoPackage.eNS_URI) : OoPackage.eINSTANCE);
		RdbPackageImpl theRdbPackage = (RdbPackageImpl)(EPackage.Registry.INSTANCE.getEPackage(RdbPackage.eNS_URI) instanceof RdbPackageImpl ? EPackage.Registry.INSTANCE.getEPackage(RdbPackage.eNS_URI) : RdbPackage.eINSTANCE);

		// Create package meta-data objects
		theOo2rdbPackage.createPackageContents();
		theOoPackage.createPackageContents();
		theRdbPackage.createPackageContents();

		// Initialize created meta-data
		theOo2rdbPackage.initializePackageContents();
		theOoPackage.initializePackageContents();
		theRdbPackage.initializePackageContents();

		// Mark meta-data to indicate it can't be changed
		theOo2rdbPackage.freeze();

  
		// Update the registry and return the package
		EPackage.Registry.INSTANCE.put(Oo2rdbPackage.eNS_URI, theOo2rdbPackage);
		return theOo2rdbPackage;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public EClass getC2T() {
		return c2TEClass;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public EReference getC2T_Src() {
		return (EReference)c2TEClass.getEStructuralFeatures().get(0);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public EReference getC2T_Trg() {
		return (EReference)c2TEClass.getEStructuralFeatures().get(1);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public EClass getAt2C() {
		return at2CEClass;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public EReference getAt2C_Src() {
		return (EReference)at2CEClass.getEStructuralFeatures().get(0);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public EReference getAt2C_Trg() {
		return (EReference)at2CEClass.getEStructuralFeatures().get(1);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public EClass getA2F() {
		return a2FEClass;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public EReference getA2F_Src() {
		return (EReference)a2FEClass.getEStructuralFeatures().get(0);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public EReference getA2F_Trg() {
		return (EReference)a2FEClass.getEStructuralFeatures().get(1);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public EClass getAt2F() {
		return at2FEClass;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public EReference getAt2F_Src() {
		return (EReference)at2FEClass.getEStructuralFeatures().get(0);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public EReference getAt2F_Trg() {
		return (EReference)at2FEClass.getEStructuralFeatures().get(1);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public EClass getInh() {
		return inhEClass;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public EReference getInh_Child() {
		return (EReference)inhEClass.getEStructuralFeatures().get(0);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public EReference getInh_Parent() {
		return (EReference)inhEClass.getEStructuralFeatures().get(1);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public EClass getAttr() {
		return attrEClass;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public EReference getAttr_Class() {
		return (EReference)attrEClass.getEStructuralFeatures().get(0);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public EReference getAttr_Attr() {
		return (EReference)attrEClass.getEStructuralFeatures().get(1);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public Oo2rdbFactory getOo2rdbFactory() {
		return (Oo2rdbFactory)getEFactoryInstance();
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	private boolean isCreated = false;

	/**
	 * Creates the meta-model objects for the package.  This method is
	 * guarded to have no affect on any invocation but its first.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public void createPackageContents() {
		if (isCreated) return;
		isCreated = true;

		// Create classes and their features
		c2TEClass = createEClass(C2T);
		createEReference(c2TEClass, C2T__SRC);
		createEReference(c2TEClass, C2T__TRG);

		at2CEClass = createEClass(AT2_C);
		createEReference(at2CEClass, AT2_C__SRC);
		createEReference(at2CEClass, AT2_C__TRG);

		a2FEClass = createEClass(A2F);
		createEReference(a2FEClass, A2F__SRC);
		createEReference(a2FEClass, A2F__TRG);

		at2FEClass = createEClass(AT2_F);
		createEReference(at2FEClass, AT2_F__SRC);
		createEReference(at2FEClass, AT2_F__TRG);

		inhEClass = createEClass(INH);
		createEReference(inhEClass, INH__CHILD);
		createEReference(inhEClass, INH__PARENT);

		attrEClass = createEClass(ATTR);
		createEReference(attrEClass, ATTR__CLASS);
		createEReference(attrEClass, ATTR__ATTR);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	private boolean isInitialized = false;

	/**
	 * Complete the initialization of the package and its meta-model.  This
	 * method is guarded to have no affect on any invocation but its first.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public void initializePackageContents() {
		if (isInitialized) return;
		isInitialized = true;

		// Initialize package
		setName(eNAME);
		setNsPrefix(eNS_PREFIX);
		setNsURI(eNS_URI);

		// Obtain other dependent packages
		OoPackage theOoPackage = (OoPackage)EPackage.Registry.INSTANCE.getEPackage(OoPackage.eNS_URI);
		RdbPackage theRdbPackage = (RdbPackage)EPackage.Registry.INSTANCE.getEPackage(RdbPackage.eNS_URI);

		// Create type parameters

		// Set bounds for type parameters

		// Add supertypes to classes

		// Initialize classes and features; add operations and parameters
		initEClass(c2TEClass, oo2rdb.C2T.class, "C2T", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
		initEReference(getC2T_Src(), theOoPackage.getClass_(), null, "src", null, 0, 1, oo2rdb.C2T.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
		initEReference(getC2T_Trg(), theRdbPackage.getTable(), null, "trg", null, 0, 1, oo2rdb.C2T.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);

		initEClass(at2CEClass, At2C.class, "At2C", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
		initEReference(getAt2C_Src(), theOoPackage.getAttribute(), null, "src", null, 0, 1, At2C.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
		initEReference(getAt2C_Trg(), theRdbPackage.getColumn(), null, "trg", null, 0, 1, At2C.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);

		initEClass(a2FEClass, oo2rdb.A2F.class, "A2F", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
		initEReference(getA2F_Src(), theOoPackage.getAssociation(), null, "src", null, 0, 1, oo2rdb.A2F.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
		initEReference(getA2F_Trg(), theRdbPackage.getFKey(), null, "trg", null, 0, 1, oo2rdb.A2F.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);

		initEClass(at2FEClass, At2F.class, "At2F", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
		initEReference(getAt2F_Src(), theOoPackage.getAttribute(), null, "src", null, 0, 1, At2F.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
		initEReference(getAt2F_Trg(), theRdbPackage.getFKey(), null, "trg", null, 0, 1, At2F.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);

		initEClass(inhEClass, Inh.class, "Inh", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
		initEReference(getInh_Child(), theOoPackage.getClass_(), null, "child", null, 0, 1, Inh.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
		initEReference(getInh_Parent(), theOoPackage.getClass_(), null, "parent", null, 0, 1, Inh.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);

		initEClass(attrEClass, Attr.class, "Attr", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
		initEReference(getAttr_Class(), theOoPackage.getClass_(), null, "class", null, 0, 1, Attr.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
		initEReference(getAttr_Attr(), theOoPackage.getClass_(), null, "attr", null, 0, 1, Attr.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);

		// Create resource
		createResource(eNS_URI);
	}

} //Oo2rdbPackageImpl
